import request from '../utils/request.js';

// 绑定微信用户 并返回token
export const login = (code) =>
  request.post('/wechat/bind', { code });

// 获取微信手机号
export const getUserInfo = () =>
  request.get('/wechat/getUserPhone');

// 获取用户今天的提醒打卡记录
export const getRemindRecordToDay = (data) =>
  request.get('/api/remindRecord/today', data);

// 获取用户今天的提醒打卡记录
export const getRemindRecordAll = (data) =>
  request.get('/api/remindRecord/all', data);

// 打卡
export const clockIn = (id, reason) => {
  let url = `/api/remindRecord/clockIn?remindId=${id}`
  if (reason) {
    url = `${url}&reason=${reason}`
  }
  return request.put(url);
}
  